package com.zmn.oms.services.interfaces.warranty;


import com.zmn.oms.model.entity.warranty.OrderWarrantyProduct;
import com.zmn.oms.model.entity.warranty.WarrantyQuery;

import java.util.Date;
import java.util.List;

/**
 * 类描述：保修产品明细
 *
 * @author heciqi
 * @date 2018/11/29 16:57
 */
public interface OrderWarrantyProductService {

	/**
	 * 按订单查询保修卡扩展产品数量
	 * @param orderId
	 * @return
	 */
	int countProExtIdByOrderId(Long orderId);

	/**
	 * 按订单id查询
	 * @param orderId
	 * @return
	 */
	List<OrderWarrantyProduct> listByOrderId(Long orderId);

	/**
	 * 条件查询
	 * @param query
	 * @return
	 */
	List<OrderWarrantyProduct> listByQuery(WarrantyQuery query);

	/**
	 * 查询多个订单id 查询
	 * @param orderIdList
	 * @return
	 */
	List<OrderWarrantyProduct> listOrderWarrantyProductByOrderIdList(List<Long> orderIdList);

	/**
	 * 新增
	 * @param orderWarrantyProducts
	 * @return
	 */
	Integer insertAll(List<OrderWarrantyProduct> orderWarrantyProducts);

	/**
	 * 修改过期时间
	 * @param orderWarrantyProduct
	 * @return
	 */
	Integer updateExpiredTime(OrderWarrantyProduct orderWarrantyProduct);

	/**
	 * @param orderId
	 * @return
	 */
	Integer deleteByOrderId(Long orderId);

	/**
	 * 根据工单Id和工单产品扩展Id删除
	 * @param orderId
	 * @param proExtId
	 */
	Integer deleteByOrderIdAndProExtId(Long orderId, Long proExtId);

	/**
	 * 修改保修卡月份
	 * @param orderId
	 * @param completeTime
	 * @param month
	 */
    void updateWarrantyMonth(Long orderId, Date completeTime, Integer month);
}
